﻿@model QuaLuuNiem.Models.BAIVIET

@{
    ViewBag.Title = "ThemBaiViet";
    Layout = "~/Views/Shared/_layoutDangnhap.cshtml";
}


<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/tinymce/jscripts/tiny_mce/tiny_mce.js")" type="text/javascript"></script>

 <script type="text/javascript">
     tinyMCE.init({ mode: "textareas", theme: "advanced", skin: "o2k7", theme_advanced_toolbar_location: "top",
         plugins: "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
                    theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
                    theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
                    theme_advanced_toolbar_location : "top",
                    theme_advanced_toolbar_align : "left",
                    theme_advanced_statusbar_location : "bottom",
                    theme_advanced_resizing : true
                    });
    </script>
<div class="center_center">
    <div class="center_danhsach">
        <h2>Thêm bài viết mới</h2>
@using (Html.BeginForm("ThemBaiViet", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
        <div class="insert">
        <label>Tên bài viết</label>
            @Html.EditorFor(model => model.TenBaiViet)
            @Html.ValidationMessageFor(model => model.TenBaiViet)
        </div>
        <div class="insert">
        <label>Nội dung bài viết</label>
            @Html.TextAreaFor(model => model.NoiDung)
            @Html.ValidationMessageFor(model => model.NoiDung)
        </div>
        <div class="insert">
        <label>Hình ảnh</label>
            <input type="file" id="Hinh" name="Hinh" />
            @Html.ValidationMessageFor(model => model.Hinh)
        </div>
        <div class="insert">
        <label>Trạng Thái</label>
            <select name="TrangThai" id="TrangThai" >
                <option value="1">Duyệt</option>
                <option value="0">Chưa duyệt</option>
            </select>
        </div>
        <p class="button">
            <input type="submit" value="Đăng bài" />
        </p>
}
    @Html.ActionLink("Quay lại trang danh sách bài viết", "danh_sach_bai_viet")
</div>
</div>
